# Contributor: Jann - Ove Risvik <jann.ove@usaklig.com>
# Maintainer:
pkgname=opensm
pkgver=3.3.24
pkgrel=2
pkgdesc="OpenSM InfiniBand subnet manager"
url="https://github.com/linux-rdma/opensm"
arch="x86 x86_64 ppc64le"
license="GPL-2.0-only OR BSD-2-Clause"
depends_dev="libibumad-dev"
makedepends="$depends_dev bison flex automake autoconf libtool linux-headers"
subpackages="$pkgname-dev $pkgname-doc $pkgname-openrc"
source="https://github.com/linux-rdma/opensm/releases/download/$pkgver/opensm-$pkgver.tar.gz
	0001-musl-fixes.patch"

prepare() {
	default_prepare
	autoreconf -fi
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--disable-static
	make
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
292449b1282008589ce6cf6a649bb64afabf359d23a8fa4afa38217801256a6a5f06912c9e463c0fdac30039aff9eceb212e8560bf05c7253c4e73080e16072e  opensm-3.3.24.tar.gz
c5f07423c9726bc4671327596d8585a669b25d75d9143db99e621ab6a08ed4aa0ee22e9725afe10bf4bf98ed503a06e9f52639f41a3cae61a34987b4ed643a32  0001-musl-fixes.patch
"
